package com.study.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import com.config.EurekaConfiguration;

/**
 * 注：@FeignClient中的name是必须要有的
 *                   url = "http://localhost:8761"指的是eureka
 *
 *
 * http://localhost:8761/eureka/apps/sunxj-microservice-provider-user
 */
@FeignClient(name = "xxx", url = "http://localhost:8761" ,
             configuration = EurekaConfiguration.class,
             fallback = EurekaFeignClientFallback.class)
public interface EurekaFeignClient {

	@RequestMapping(value = "/eureka/apps/{serviceName}")
	public String findServiceInfoFromEurekaByServiceName(@PathVariable("serviceName") String serviceName);
}
